<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    .box {
        width: 200px;
        height: 200px;
        background-color: red;
    }

    .box2 {
        width: 100px;
        height: 100px;
        background-color: rgb(31, 1, 229);
    }
</style>

<body>
    <div id="app">

        <!-- <div v-on:click="fn">事件</div> -->
        <!-- @ 表示绑定某某事件 -->
        <!-- <div @click="fn">事件</div> -->
        <!-- 后缀 修饰符   -->

        <div @click="fn2" class="box">

            <div @click.stop="fn" class="box2"></div>
        </div>


        <form action="http://baidu.com" method="post">
            <button @click.prevent>跳转</button>
            <button @click.prevent="fn">跳转</button>
        </form>

        <input @keydown.enter.once.stop="fn2" type="text">
        <input @keydown.13="fn2" type="text">


    </div>
</body>
<script src="../../static/vue.js"></script>
<script>
    new Vue({
        el: "#app",
        data: {
            name: "666"
        },
        methods: {
            fn() {
                console.log("里层");
            },
            fn2() {
                console.log("外层");
            },
            fn3: function () {

            }
        },
    })


</script>

</html>